package com.inews.business.wangpan.baidu;

import java.io.File;
import java.util.Map;

import com.inews.base.mapper.JsonMapper;
import com.inews.business.vo.JinShanResultVo;

public class BaiduPanUtil {

	
	 
	

	public static String disInfo() throws Exception{
			return BaiduPan.info();
	}

	
//	public static  Map<String,Object> metadata() throws Exception{
//		
//		KuaiPan kuaipan = BaiduPanUtil.getinstatice("metadata");
//		  kuaipan.setPath("/test");
//		  kuaipan.setRoot("kuaipan");
//	  kuaipan.setOauth_version("1.0");
//	  Map<String,Object> result=kuaipan.submit();
//	
//	   
//	   
//	   JinShanResultVo vo= JsonMapper.nonEmptyMapper().JSONtoObject(result.get("t_result").toString(), JinShanResultVo.class);//.toJson(extData);
//	
//	  return result;
//	}
//	public static Map<String,Object> download_file(String fileName) throws Exception{
//	
//		KuaiPan kuaipan = BaiduPanUtil.getinstatice("download_file");
//	kuaipan.setPath("/test/"+fileName);
//	 kuaipan.setRoot("kuaipan");		 
//	  kuaipan.setOauth_version("1.0");
//	  Map<String,Object> result=kuaipan.submit();
//	  
//	  return result;
//}
//
//public static void main(String[] args) throws Exception {
//	BaiduPanUtil.upload_file(new File("D:\\a.txt"),"test1.txt");
//
//}
//
//public static String stringToUnicode(String s) {
//
//	String str = "";
//	for (int i = 0; i < s.length(); i++) {
//	int ch = (int) s.charAt(i);
//	str += "\\u" + Integer.toHexString(ch);
//	}
//	return str;
//
//	}
//
//public static  Map<String,Object> upload_file(File uploadFile,String fileName) throws Exception{
//	KuaiPan kuaipan = BaiduPanUtil.getinstatice("upload_file");
//	kuaipan.setOverwrite(true);
//	kuaipan.setPath("/test/"+fileName);
//	kuaipan.setRoot("kuaipan");
//	kuaipan.setLocal_file(uploadFile);
//	Map<String,Object> map = kuaipan.submit();
//	System.out.println(map.get("state"));
//	return map;
//}



}



